package api

import (
	request "gitee.com/changeden/volcengine-livesaas-request-go"
)

type GetStreamsRequest struct {
	ActivityId *int64 `json:"ActivityId"`
}
type GetStreamsResponse struct {
	LineDetails []LineDetail `json:"LineDetails"`
}
type LineDetail struct {
	LineId            int64       `json:"LineId"`
	LineName          string      `json:"LineName"`
	MainPushInfo      PushInfo    `json:"MainPushInfo"`
	BackPushInfo      PushInfo    `json:"BackPushInfo"`
	ForwardInfo       ForwardInfo `json:"ForwardInfo"`
	BackupForwardInfo ForwardInfo `json:"BackupForwardInfo"`
	ExpireTime        int64       `json:"ExpireTime"`
	LineIndex         int64       `json:"LineIndex"`
	MainBackupType    int32       `json:"MainBackupType"`
	LoopVideoStatus   int32       `json:"LoopVideoStatus"`
}
type PushInfo struct {
	PushUrl       string `json:"PushUrl"`
	PushPath      string `json:"PushPath"`
	StreamingCode string `json:"StreamingCode"`
}
type ForwardInfo struct {
	PullStreamUrl            string `json:"PullStreamUrl"`
	PullStreamStatus         int32  `json:"PullStreamStatus"`
	PullStreamCheckStatus    int32  `json:"PullStreamCheckStatus"`
	PullStreamCheckMessage   string `json:"PullStreamCheckMessage"`
	PullStreamLineId         int64  `json:"PullStreamLineId"`
	PullStreamMainBackupMode int32  `json:"PullStreamMainBackupMode"`
	PullStreamExpireTime     int64  `json:"PullStreamExpireTime"`
}

func (instance *Instance) GetStreams(data *GetStreamsRequest) (*GetStreamsResponse, error) {
	d := request.Data{
		Action: "GetStreamsAPI",
	}
	bindQuery(&d, *data)
	var r GetStreamsResponse
	err := instance.get(&d, &r)
	return &r, err
}
